const express = require('express');
const get_method = require('../mether/get_method');

// express有提供一个顶级的路由模块。直接使用
const router = express.Router();

const routers = {
  "/auth/token": get_method.token,
  "/secure-api/my-favorite": get_method.favorite,
  "/public-api/result": get_method.result,
  "/secure-api/port-code-enquiry": get_method.port_code_enquiry,
  "/test": get_method.test,
  "/public-api/vessel-name-list": get_method.getVesselNameList,
  "/secure-api/vessel-voyage-list": get_method.getVesselVoyageList,
  "/secure-api/accessible-operator-list": get_method.getOperators,
  "/secure-api/storage-report": get_method.storage_report,
  "/auth/email/***": get_method.getEmail,
  "/secure-api/empty-container-list": get_method.emptyContainerList,
  '/secure-api/empty-container-list-detail': get_method.emptyContainerListDetail,
  '/secure-api/uc-inventory-list': get_method.ucInventoryList,
  '/secure-api/container-inventory-list-and-summary': get_method.containerInventoryListAndSummary,
  '/secure-api/empty-pool-daily-report': get_method.emptyPoolDailyReport,
  '/secure-api/empty-pool-monthly-report': get_method.emptyPoolMonthlyReport,
  '/secure-api/empty-pool-report-by-id': get_method.emptyPoolReportById,
}

Object.keys(routers).forEach(item => {
  router.get(item, routers[item])
})

module.exports = router